package com.example.slack;

import com.slack.api.bolt.App;
// If you use bolt-jakarta-jetty, you can import `com.slack.api.bolt.jakarta_jetty.SlackAppServer` instead
import com.slack.api.bolt.AppConfig;
import com.slack.api.bolt.jetty.SlackAppServer;

/**
 * https://slack.dev/java-slack-sdk/guides/getting-started-with-bolt
 */
public class MyApp {
    public static void main(String[] args) throws Exception {
        // App expects env variables (SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET)
        AppConfig config = new AppConfig();
        config.setSingleTeamBotToken("xoxb-5118834517970-7638001418117-H9oFBenJcc02TtocUYrmPjbP");
        config.setSigningSecret("bc2a64a65f3b6b62820aae28fbf0def7");
        App app = new App(config);

//        app.client().filesUploadV2();

//        // 可以写多个slash命令
//        app.command("/hello2", (req, ctx) -> {
//            return ctx.ack("你好啊 Hello!");
//        });
//        app.command("/hello", (req, ctx) -> {
//            return ctx.ack("你好啊 Hello!");
//        });
//
//        SlackAppServer server = new SlackAppServer(app);
//        server.start(); // http://localhost:3000/slack/events
    }
}